"""nosy_system URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/3.0/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  path('', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  path('', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.urls import include, path
    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))
"""
# from django.contrib import admin
from django.urls import path, re_path
from app01 import views
from django.views.static import serve
# from django.conf.urls.static import static
from django.conf import settings

urlpatterns = [
                  # path('admin/', admin.site.urls),
                  # 关联本项目以外数据收集程序的目录为DJango所调用（html不能访问本地目录），用以在网页上显示结果图片
                  re_path(r'^image/(?P<path>.*)$', serve, {'document_root': settings.TEST_ROOT}),
                  re_path(r'^bgimage/(?P<path>.*)$', serve, {'document_root': settings.BG_ROOT}),
                  re_path(r'^img/(?P<path>.*)$', serve, {'document_root': settings.MEDIA_ROOT}),

                  path(r"admin.html/", views.admin, name='admin'),
                  path(r"init.html/", views.init, name='init'),
                  path(r"init_items.html/", views.init_items, name='init_items'),

                  path(r"admin/manage_item_price.html/", views.manage_item_price, name='manage_item_price'),
                  path(r"admin/item/add.html/", views.item_add, name='item_add'),
                  path(r"admin/item/<int:iid>/edit.html/", views.item_edit, name='item_edit'),
                  path(r"admin/item/del.html/", views.item_del, name='item_del'),
                  path(r"admin_top/customer/list.html/", views.admin_customer_list, name='admin_customer_list'),
                  path(r"admin_top/customer/del.html/", views.customer_del, name='customer_del'),

                  path(r"admin/accounts.html/", views.admin_accounts, name='admin_accounts'),
                  path(r"admin/accounts/add.html/", views.accounts_add, name='accounts_add'),
                  path(r"admin/accounts/<int:uid>/edit.html/", views.accounts_edit, ),
                  path(r"admin/accounts/del.html/", views.accounts_del, name='accounts_del'),

                  path(r"login.html/", views.login, name='login'),
                  path(r"logout.html/", views.logout, name='logout'),
                  path(r"edit_username.html/", views.edit_username, name='edit_username'),
                  path(r"check_user_name.html/", views.check_user_name, name='check_user_name'),
                  path(r"edit_nickname.html/", views.edit_nickname, name='edit_nickname'),
                  path(r"home.html/", views.home, name='home'),

                  path(r"customer/<int:pid>/details.html/", views.customer_details, name='customer_details'),
                  path(r"customer_list.html/", views.customer_list, name='customer_list'),
                  path(r"show_customer.html/", views.show_customer, name='show_customer'),
                  path(r"search_customer.html/", views.search_customer, name='search_customer'),
                  path(r"customer_add.html/", views.customer_add, name='customer_add'),
                  path(r"customer/<int:pid>/edit.html/", views.customer_edit, name='customer_edit'),

                  path(r"test/<int:test_id>/edit.html/", views.test_edit, name='test_edit'),
                  path(r"test/<int:pid>/add.html/", views.test_add, name='test_add'),
                  path(r"test/del.html/", views.test_del, name='test_del'),
                  path(r"test/save_test_report.html/", views.save_test_report, name='save_test_report'),

                  path(r"buying/<int:pid>/add.html/", views.buying_add, name='buying_add'),
                  path(r"buying/<int:buying_id>/edit.html/", views.buying_edit, name='buying_edit'),
                  path(r"buying/<int:buying_id>/check.html/", views.buying_check, name='buying_check'),

                  path(r"video_cap/<int:lt>/<int:st>.html/", views.video_cap, name='video_cap'),
                  path(r"release_cap/<int:pid>.html/", views.release_cap, name='release_cap'),
                  path(r"image_cap.html/", views.image_cap, name='image_cap'),
                  path(r"save_and_del_img.html/", views.save_and_del_img, name='save_and_del_img'),
                  path(r"camera/<int:pid>/add_test.html/", views.camera_test_add, name='camera_test_add'),
                  path(r"camera/<int:test_id>/test.html/", views.camera_test, name='camera_test'),

                  path(r"test_report/<int:test_id>/edit.html/", views.test_report_edit, name='test_report_edit'),
                  path(r"test_report.html/", views.test_report, name='test_report'),
                  path(r"refresh_trail_counts.html/", views.refresh_trail_counts, name='refresh_trail_counts'),
                  path(r"error.html/", views.error_page, name='error_page'),
                  # 图表展示
                  path(r"admin/chart.html/", views.chart, name='chart'),
                  path(r"chart_test_p_day.html/", views.chart_test_p_day, name='chart_test_p_day'),
                  path(r"chart_total_amount_p_c.html/", views.chart_total_amount_p_c, name='chart_total_amount_p_c'),
                  # 回访

                  path(r"returning_visits/<int:pid>/list.html/", views.returning_visits_list, ),
                  path(r"returning_visits/<int:pid>/add.html/", views.returning_visits_add, ),
                  path(r"returning_visits/<int:rid>/edit.html/", views.returning_visits_edit, ),

                  # 局部信息展示
                  path(r"show/info.html/", views.show_info, name='show_info'),

                  # 报告单模板
                  path(r"test_report_model.html/", views.test_report_model, name='test_report_model'),


              ] 
